import java.util.*;

public class Main {
    // 查找兄弟单词
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String[] strings = new String[n];

        for (int i = 0; i < n; i++) {
            strings[i] = in.next();
        }

        String key = in.next();
        int k = in.nextInt();
        List<String> list = new LinkedList<>();
        Map<Character, Integer> keyMap = new HashMap<>();
        for (int i = 0; i < key.length(); i++) {
            if (!keyMap.containsKey(key.charAt(i))) {
                keyMap.put(key.charAt(i), 1);
            } else {
                keyMap.put(key.charAt(i), keyMap.get(key.charAt(i))+1);
            }
        }

        for (String string : strings) {
            Map<Character, Integer> map = new HashMap<>();

            for (int j = 0; j < string.length(); j++) {
                if (!map.containsKey(string.charAt(j))) {
                    map.put(string.charAt(j), 1);
                } else {
                    map.put(string.charAt(j), map.get(string.charAt(j)) + 1);
                }
            }

            if (string.equals(key) || string.length() != key.length()) {
                continue;
            }
            boolean flag = true;
            for (int j = 0; j < string.length(); j++) {
                if (!keyMap.containsKey(string.charAt(j))) {
                    flag = false;
                    continue;
                }
                if (!Objects.equals(map.get(string.charAt(j)), keyMap.get(string.charAt(j)))) {
                    flag = false;
                }
            }
            if (flag) {
                list.add(string);
            }
        }
        list.sort(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareTo(o2);
            }
        });
        System.out.println(list.size());
        if (k < list.size()) {
            System.out.println(list.get(k-1));

        }
    }


    // 乒乓球筐
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()) {
            String s1 = in.next();
            String s2 = in.next();
            Map<Character, Integer> map1 = new HashMap<>();
            Map<Character, Integer> map2 = new HashMap<>();

            for (int i = 0; i < s1.length(); i++) {
                if (!map1.containsKey(s1.charAt(i))) {
                    map1.put(s1.charAt(i), 1);
                } else {
                    map1.put(s1.charAt(i), map1.get(s1.charAt(i))+1);
                }
            }
            for (int i = 0; i < s2.length(); i++) {
                if (!map2.containsKey(s2.charAt(i))) {
                    map2.put(s2.charAt(i), 1);
                } else {
                    map2.put(s2.charAt(i), map2.get(s2.charAt(i))+1);
                }
            }

            boolean flg = true;
            for (int i = 0; i < s2.length(); i++) {
                if (!map1.containsKey(s2.charAt(i)) || map1.getOrDefault(s2.charAt(i), 0) < map2.get(s2.charAt(i))) {
                    System.out.println("No");
                    flg = false;
                    break;
                }
            }
            if (flg) {
                System.out.println("Yes");
            }
        }
    }

    // 单词倒排
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        List<String> list = new ArrayList<>();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (Character.isLetter(s.charAt(i))) {
                sb.append(s.charAt(i));
            } else {
                list.add(sb.toString());
                sb = new StringBuilder();
            }
        }
        list.add(sb.toString());

        StringBuilder stringBuilder = new StringBuilder();

        for (int i = list.size()-1; i >= 0; i--) {
            stringBuilder.append(list.get(i)).append(" ");
        }
        System.out.println(stringBuilder);
    }

    // 骆驼命名法
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNext()) {
            String[] s = in.next().split("_");
            StringBuilder stringBuilder = new StringBuilder(s[0]);

            if (s.length == 1) {
                System.out.println(stringBuilder);
                continue;
            }

            for (int i = 1; i < s.length; i++) {
                stringBuilder.append(Character.toUpperCase(s[i].charAt(0))).append(s[i].substring(1));
            }
            System.out.println(stringBuilder);
        }
    }
}
